<template>
    <div class="orders">
       <div class="detail" v-if="$route.query.id">
        <detail></detail>
    </div>
       <div class="allOrders" v-else>
         <AllOrders></AllOrders>
       </div>
    </div>
</template>

<script setup lang="ts">
//引入路由对象
import {useRoute} from 'vue-router'
//引入组件
import detail from './detail/index.vue'
import AllOrders from './AllOrders/index.vue'
let $route = useRoute();
</script>

<style scoped lang="scss">
   .orders {
      .detail {
         margin-top: 30px;
      }
   }
</style>